<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>libwebsockets: Extensions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="libwebsockets.org-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libwebsockets
   </div>
   <div id="projectbrief">Lightweight C library for HTML5 websockets</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__extensions.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Extensions</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlws__ext__options.html">lws_ext_options</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlws__ext__option__arg.html">lws_ext_option_arg</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlws__extension.html">lws_extension</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gaae7169b2cd346b34fa33d0250db2afd0"><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__extensions.html#gaae7169b2cd346b34fa33d0250db2afd0">lws_extension_callback_function</a>(struct lws_context *context, const struct <a class="el" href="structlws__extension.html">lws_extension</a> *ext, struct lws *wsi, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len)</td></tr>
<tr class="separator:gaae7169b2cd346b34fa33d0250db2afd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gae9993815eee72c6070300a0ae2f022d7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae9993815eee72c6070300a0ae2f022d7"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>lws_extension_callback_reasons</b> { <br />
&#160;&#160;<b>LWS_EXT_CB_SERVER_CONTEXT_CONSTRUCT</b> = 0, 
<b>LWS_EXT_CB_CLIENT_CONTEXT_CONSTRUCT</b> = 1, 
<b>LWS_EXT_CB_SERVER_CONTEXT_DESTRUCT</b> = 2, 
<b>LWS_EXT_CB_CLIENT_CONTEXT_DESTRUCT</b> = 3, 
<br />
&#160;&#160;<b>LWS_EXT_CB_CONSTRUCT</b> = 4, 
<b>LWS_EXT_CB_CLIENT_CONSTRUCT</b> = 5, 
<b>LWS_EXT_CB_CHECK_OK_TO_REALLY_CLOSE</b> = 6, 
<b>LWS_EXT_CB_CHECK_OK_TO_PROPOSE_EXTENSION</b> = 7, 
<br />
&#160;&#160;<b>LWS_EXT_CB_DESTROY</b> = 8, 
<b>LWS_EXT_CB_DESTROY_ANY_WSI_CLOSING</b> = 9, 
<b>LWS_EXT_CB_ANY_WSI_ESTABLISHED</b> = 10, 
<b>LWS_EXT_CB_PACKET_RX_PREPARSE</b> = 11, 
<br />
&#160;&#160;<b>LWS_EXT_CB_PACKET_TX_PRESEND</b> = 12, 
<b>LWS_EXT_CB_PACKET_TX_DO_SEND</b> = 13, 
<b>LWS_EXT_CB_HANDSHAKE_REPLY_TX</b> = 14, 
<b>LWS_EXT_CB_FLUSH_PENDING_TX</b> = 15, 
<br />
&#160;&#160;<b>LWS_EXT_CB_EXTENDED_PAYLOAD_RX</b> = 16, 
<b>LWS_EXT_CB_CAN_PROXY_CLIENT_CONNECTION</b> = 17, 
<b>LWS_EXT_CB_1HZ</b> = 18, 
<b>LWS_EXT_CB_REQUEST_ON_WRITEABLE</b> = 19, 
<br />
&#160;&#160;<b>LWS_EXT_CB_IS_WRITEABLE</b> = 20, 
<b>LWS_EXT_CB_PAYLOAD_TX</b> = 21, 
<b>LWS_EXT_CB_PAYLOAD_RX</b> = 22, 
<b>LWS_EXT_CB_OPTION_DEFAULT</b> = 23, 
<br />
&#160;&#160;<b>LWS_EXT_CB_OPTION_SET</b> = 24, 
<b>LWS_EXT_CB_OPTION_CONFIRM</b> = 25, 
<b>LWS_EXT_CB_NAMED_OPTION_SET</b> = 26
<br />
 }</td></tr>
<tr class="separator:gae9993815eee72c6070300a0ae2f022d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacc9f55936dc165257a2e1f7d47bce89e"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__extensions.html#gacc9f55936dc165257a2e1f7d47bce89e">lws_ext_options_types</a> { <a class="el" href="group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c">EXTARG_NONE</a>, 
<a class="el" href="group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e">EXTARG_DEC</a>, 
<a class="el" href="group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880">EXTARG_OPT_DEC</a>
 }</td></tr>
<tr class="separator:gacc9f55936dc165257a2e1f7d47bce89e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gae0e24e1768f83a7fb07896ce975704b9"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__extensions.html#gae0e24e1768f83a7fb07896ce975704b9">lws_set_extension_option</a> (struct lws *wsi, const char *ext_name, const char *opt_name, const char *opt_val)</td></tr>
<tr class="separator:gae0e24e1768f83a7fb07896ce975704b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6fb3e2c3dfb9d64dc87026a4e99c128b"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__extensions.html#ga6fb3e2c3dfb9d64dc87026a4e99c128b">lws_ext_parse_options</a> (const struct <a class="el" href="structlws__extension.html">lws_extension</a> *ext, struct lws *wsi, void *ext_user, const struct <a class="el" href="structlws__ext__options.html">lws_ext_options</a> *opts, const char *o, int len)</td></tr>
<tr class="separator:ga6fb3e2c3dfb9d64dc87026a4e99c128b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4cdbe42d872e21a448a947714d6c607e"><td class="memItemLeft" align="right" valign="top">LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__extensions.html#ga4cdbe42d872e21a448a947714d6c607e">lws_extension_callback_pm_deflate</a> (struct lws_context *context, const struct <a class="el" href="structlws__extension.html">lws_extension</a> *ext, struct lws *wsi, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len)</td></tr>
<tr class="separator:ga4cdbe42d872e21a448a947714d6c607e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2>Extension releated functions</h2>
<p>Ws defines optional extensions, lws provides the ability to implement these in user code if so desired.</p>
<p>We provide one extensions permessage-deflate. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="gaae7169b2cd346b34fa33d0250db2afd0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int lws_extension_callback_function(struct lws_context *context, const struct <a class="el" href="structlws__extension.html">lws_extension</a> *ext, struct lws *wsi, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p>typedef <a class="el" href="group__extensions.html#gaae7169b2cd346b34fa33d0250db2afd0">lws_extension_callback_function()</a> - Hooks to allow extensions to operate </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>Websockets context </td></tr>
    <tr><td class="paramname">ext</td><td>This extension </td></tr>
    <tr><td class="paramname">wsi</td><td>Opaque websocket instance pointer </td></tr>
    <tr><td class="paramname">reason</td><td>The reason for the call </td></tr>
    <tr><td class="paramname">user</td><td>Pointer to ptr to per-session user data allocated by library </td></tr>
    <tr><td class="paramname">in</td><td>Pointer used for some callback reasons </td></tr>
    <tr><td class="paramname">len</td><td>Length set for some callback reasons <pre class="fragment"> Each extension that is active on a particular connection receives
 callbacks during the connection lifetime to allow the extension to
 operate on websocket data and manage itself.

 Libwebsockets takes care of allocating and freeing "user" memory for
 each active extension on each connection.  That is what is pointed to
 by the user parameter.

 LWS_EXT_CB_CONSTRUCT:  called when the server has decided to
    select this extension from the list provided by the client,
    just before the server will send back the handshake accepting
    the connection with this extension active.  This gives the
    extension a chance to initialize its connection context found
    in user.

 LWS_EXT_CB_CLIENT_CONSTRUCT: same as LWS_EXT_CB_CONSTRUCT
    but called when client is instantiating this extension.  Some
    extensions will work the same on client and server side and then
    you can just merge handlers for both CONSTRUCTS.

 LWS_EXT_CB_DESTROY:  called when the connection the extension was
    being used on is about to be closed and deallocated.  It's the
    last chance for the extension to deallocate anything it has
    allocated in the user data (pointed to by user) before the
    user data is deleted.  This same callback is used whether you
    are in client or server instantiation context.

 LWS_EXT_CB_PACKET_RX_PREPARSE: when this extension was active on
    a connection, and a packet of data arrived at the connection,
    it is passed to this callback to give the extension a chance to
    change the data, eg, decompress it.  user is pointing to the
    extension's private connection context data, in is pointing
    to an lws_tokens struct, it consists of a char * pointer called
    token, and an int called token_len.  At entry, these are
    set to point to the received buffer and set to the content
    length.  If the extension will grow the content, it should use
    a new buffer allocated in its private user context data and
    set the pointed-to lws_tokens members to point to its buffer.

 LWS_EXT_CB_PACKET_TX_PRESEND: this works the same way as
    LWS_EXT_CB_PACKET_RX_PREPARSE above, except it gives the
    extension a chance to change websocket data just before it will
    be sent out.  Using the same lws_token pointer scheme in in,
    the extension can change the buffer and the length to be
    transmitted how it likes.  Again if it wants to grow the
    buffer safely, it should copy the data into its own buffer and
    set the lws_tokens token pointer to it.

 LWS_EXT_CB_ARGS_VALIDATE:</pre> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="gacc9f55936dc165257a2e1f7d47bce89e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__extensions.html#gacc9f55936dc165257a2e1f7d47bce89e">lws_ext_options_types</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p>enum lws_ext_options_types </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c"></a>EXTARG_NONE&#160;</td><td class="fielddoc">
<p>does not take an argument </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e"></a>EXTARG_DEC&#160;</td><td class="fielddoc">
<p>requires a decimal argument </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880"></a>EXTARG_OPT_DEC&#160;</td><td class="fielddoc">
<p>may have an optional decimal argument </p>
</td></tr>
</table>
<div class="fragment"><div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>&#160;                           {</div><div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>&#160;        <a class="code" href="group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c">EXTARG_NONE</a>, </div><div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>&#160;        <a class="code" href="group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e">EXTARG_DEC</a>,  </div><div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>&#160;        <a class="code" href="group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880">EXTARG_OPT_DEC</a> </div><div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>&#160;        <span class="comment">/* Add new things just above here ---^</span></div><div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>&#160;<span class="comment">         * This is part of the ABI, don&#39;t needlessly break compatibility */</span></div><div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>&#160;};</div><div class="ttc" id="group__extensions_html_ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880"><div class="ttname"><a href="group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880">EXTARG_OPT_DEC</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1098</div></div>
<div class="ttc" id="group__extensions_html_ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c"><div class="ttname"><a href="group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c">EXTARG_NONE</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1096</div></div>
<div class="ttc" id="group__extensions_html_ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e"><div class="ttname"><a href="group__extensions.html#ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e">EXTARG_DEC</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1097</div></div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga6fb3e2c3dfb9d64dc87026a4e99c128b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_ext_parse_options </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structlws__extension.html">lws_extension</a> *&#160;</td>
          <td class="paramname"><em>ext</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ext_user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="structlws__ext__options.html">lws_ext_options</a> *&#160;</td>
          <td class="paramname"><em>opts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>o</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__extensions.html#ga6fb3e2c3dfb9d64dc87026a4e99c128b">lws_ext_parse_options()</a> - deal with parsing negotiated extension options</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ext</td><td>related extension struct </td></tr>
    <tr><td class="paramname">wsi</td><td>websocket connection </td></tr>
    <tr><td class="paramname">ext_user</td><td>per-connection extension private data </td></tr>
    <tr><td class="paramname">opts</td><td>list of supported options </td></tr>
    <tr><td class="paramname">o</td><td>option string to parse </td></tr>
    <tr><td class="paramname">len</td><td>length </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga4cdbe42d872e21a448a947714d6c607e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_EXTERN int lws_extension_callback_pm_deflate </td>
          <td>(</td>
          <td class="paramtype">struct lws_context *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="structlws__extension.html">lws_extension</a> *&#160;</td>
          <td class="paramname"><em>ext</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum lws_extension_callback_reasons&#160;</td>
          <td class="paramname"><em>reason</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__extensions.html#ga4cdbe42d872e21a448a947714d6c607e">lws_extension_callback_pm_deflate()</a> - extension for RFC7692</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>lws context </td></tr>
    <tr><td class="paramname">ext</td><td>related <a class="el" href="structlws__extension.html">lws_extension</a> struct </td></tr>
    <tr><td class="paramname">wsi</td><td>websocket connection </td></tr>
    <tr><td class="paramname">reason</td><td>incoming callback reason </td></tr>
    <tr><td class="paramname">user</td><td>per-connection extension private data </td></tr>
    <tr><td class="paramname">in</td><td>pointer parameter </td></tr>
    <tr><td class="paramname">len</td><td>length parameter</td></tr>
  </table>
  </dd>
</dl>
<p>Built-in callback implementing RFC7692 permessage-deflate </p>

</div>
</div>
<a class="anchor" id="gae0e24e1768f83a7fb07896ce975704b9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_set_extension_option </td>
          <td>(</td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ext_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>opt_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>opt_val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__extensions.html#gae0e24e1768f83a7fb07896ce975704b9">lws_set_extension_option()</a>: set extension option if possible</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>websocket connection </td></tr>
    <tr><td class="paramname">ext_name</td><td>name of ext, like "permessage-deflate" </td></tr>
    <tr><td class="paramname">opt_name</td><td>name of option, like "rx_buf_size" </td></tr>
    <tr><td class="paramname">opt_val</td><td>value to set option to </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
